import { Table, Column, Model, DataType } from 'sequelize-typescript';

@Table({ tableName: '{{feature}}', timestamps: true })
export class {{modelName}} extends Model<{{modelName}}> {
  {{!-- sequelize自主处理id字段 --}}
  {{!-- @Column({ type: DataType.INTEGER, autoIncrement: true, primaryKey: true })
  id!: number; --}}
{{#each fields}}

  @Column({ type: {{#if (eq this.type "number")}}DataType.INTEGER{{else if (eq this.type "boolean")}}DataType.BOOLEAN{{else if (eq this.type "Date")}}DataType.DATE{{else}}DataType.STRING{{/if}} })
  {{this.name}}!: {{this.type}};
{{/each}}
}
